obj=add-year-safe write-records

all: $(obj)

prebuild: write-record.s read-record.s \
	write-newline.s count-chars.s error-exit.s
	as -g error-exit.s -o error-exit.o
	as -g write-record.s -o write-record.o
	as -g read-record.s -o read-record.o
	as -g write-newline.s -o write-newline.o
	as -g count-chars.s -o count-chars.o

write-records: write-records.s prebuild
	as -g write-records.s -o write-records.o
	ld write-records.o write-record.o write-newline.o -o write-records


add-year-safe: add-year-safe.s prebuild
	as -g add-year-safe.s -o add-year.o
	ld add-year.o error-exit.o count-chars.o \
 	read-record.o write-record.o write-newline.o \
	-o add-year-safe

clean:
	-rm $(obj) *.o
